from conf.readConfig import ReadConfig
import os
import requests


class ReadAuthkeySessionid():

    def read_authkey_sessionid(self):
        test_http_url = ReadConfig().get_url("test_http_url")
        dev_http_url = ReadConfig().get_url("dev_http_url")
        url = test_http_url + "admin/base/login"
        print(test_http_url,dev_http_url,url)
        payload = {"username":"lsxd","password":"123456","isRemember":0}
        r = requests.post(url,data=payload)
        result = r.json()
        authkey =result['data']['authKey']
        sessionid = result['data']['sessionId']
        headlist = [authkey,sessionid]
        return headlist

if __name__ == "__main__":
    ReadAuthkeySessionid().read_authkey_sessionid()